<?   

    /* Mini Shoutcast based auto dj with hot rotation functionality
     * Matthias Kallenbach, 2014, Berlin
     * 
     * tested on windows 7, LAMP (xampp)
     * 
     * php.ini
     *      error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED
     *      short_open_tag = On
     *      
     * 
     * .htaccess
     *      <IfModule mod_rewrite.c>
     *          RewriteEngine On
     *          RewriteBase /
     *          RewriteCond %{REQUEST_FILENAME} !-f
     *          RewriteCond %{REQUEST_FILENAME} !-d
     *          RewriteRule . index.php [L]
     *      </IfModule>  
     * 
     */
     
        
    session_start();

    include('inc/config.php');
    include('inc/functions.php');
    include_once('source/controller/mainController.php');
    
    if(!$_SESSION['playlist'])
        $_SESSION['playlist'] = array();
        
    $uri        = getUriPages();
    $slug       = $uri[0];
    $main       = new mainController();
    
    if($slug=='') {
        $slug = 'index';
    }
    
    if(method_exists($main,$slug.'Action')) {
        $action = $main->{$slug.'Action'}();
        echo partial($slug,$action);
    }  
?>